# Copyright 2010-2024 Google LLC
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

_workspace_root = package_relative_label("@glpk//:__pkg__").workspace_root

cc_library(
    name = "glpk",
    srcs = glob(
        [
            "src/*/*.c",
            "src/*.h",
            "src/*/*.h",
        ],
        exclude = [
            "src/proxy/main.c",
            "src/zlib/*",
        ],
    ),
    hdrs = [
        "src/glpk.h",
    ],
    copts = [
        "-w",
        "-I" + _workspace_root + "/src",
        "-I" + _workspace_root + "/src/amd",
        "-I" + _workspace_root + "/src/api",
        "-I" + _workspace_root + "/src/bflib",
        "-I" + _workspace_root + "/src/colamd",
        "-I" + _workspace_root + "/src/draft",
        "-I" + _workspace_root + "/src/env",
        "-I" + _workspace_root + "/src/intopt",
        "-I" + _workspace_root + "/src/minisat",
        "-I" + _workspace_root + "/src/misc",
        "-I" + _workspace_root + "/src/mpl",
        "-I" + _workspace_root + "/src/npp",
        "-I" + _workspace_root + "/src/proxy",
        "-I" + _workspace_root + "/src/simplex",
    ],
    includes = ["src"],
    visibility = ["//visibility:public"],
    deps = ["@zlib"],
)
